home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / QuickTimeVRFormat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  14.2 KB  |  487 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeVRFormat.h
  3.  
  4.      Contains:    QuickTime VR interfaces
  5.  
  6.      Version:    Technology:    QuickTime VR 2.1
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QUICKTIMEVRFORMAT__
  19. #define __QUICKTIMEVRFORMAT__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKTIMEVR__
  31. #include <QuickTimeVR.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56.  
  57. /* File Format Version numbers */
  58. #define kQTVRMajorVersion (2)
  59. #define kQTVRMinorVersion (0)
  60.  
  61. /* User data type for the Movie Controller type specifier*/
  62.  
  63. enum {
  64.     kQTControllerType            = kQTVRControllerSubType,        /* Atom & ID of where our*/
  65.     kQTControllerID                = 1                                /* … controller name is stored*/
  66. };
  67.  
  68. /* VRWorld atom types*/
  69.  
  70. enum {
  71.     kQTVRWorldHeaderAtomType    = FOUR_CHAR_CODE('vrsc'),
  72.     kQTVRImagingParentAtomType    = FOUR_CHAR_CODE('imgp'),
  73.     kQTVRPanoImagingAtomType    = FOUR_CHAR_CODE('impn'),
  74.     kQTVRObjectImagingAtomType    = FOUR_CHAR_CODE('imob'),
  75.     kQTVRNodeParentAtomType        = FOUR_CHAR_CODE('vrnp'),
  76.     kQTVRNodeIDAtomType            = FOUR_CHAR_CODE('vrni'),
  77.     kQTVRNodeLocationAtomType    = FOUR_CHAR_CODE('nloc')
  78. };
  79.  
  80. /* NodeInfo atom types*/
  81.  
  82. enum {
  83.     kQTVRNodeHeaderAtomType        = FOUR_CHAR_CODE('ndhd'),
  84.     kQTVRHotSpotParentAtomType    = FOUR_CHAR_CODE('hspa'),
  85.     kQTVRHotSpotAtomType        = FOUR_CHAR_CODE('hots'),
  86.     kQTVRHotSpotInfoAtomType    = FOUR_CHAR_CODE('hsin'),
  87.     kQTVRLinkInfoAtomType        = FOUR_CHAR_CODE('link')
  88. };
  89.  
  90. /* Miscellaneous atom types*/
  91.  
  92. enum {
  93.     kQTVRStringAtomType            = FOUR_CHAR_CODE('vrsg'),
  94.     kQTVRPanoSampleDataAtomType    = FOUR_CHAR_CODE('pdat'),
  95.     kQTVRObjectInfoAtomType        = FOUR_CHAR_CODE('obji'),
  96.     kQTVRImageTrackRefAtomType    = FOUR_CHAR_CODE('imtr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  97.     kQTVRHotSpotTrackRefAtomType = FOUR_CHAR_CODE('hstr'),        /* Parent is kQTVRObjectInfoAtomType. Required if track ref is not 1 as required by 2.0 format.*/
  98.     kQTVRAngleRangeAtomType        = FOUR_CHAR_CODE('arng'),
  99.     kQTVRTrackRefArrayAtomType    = FOUR_CHAR_CODE('tref'),
  100.     kQTVRPanConstraintAtomType    = FOUR_CHAR_CODE('pcon'),
  101.     kQTVRTiltConstraintAtomType    = FOUR_CHAR_CODE('tcon'),
  102.     kQTVRFOVConstraintAtomType    = FOUR_CHAR_CODE('fcon')
  103. };
  104.  
  105.  
  106. enum {
  107.     kQTVRObjectInfoAtomID        = 1,
  108.     kQTVRObjectImageTrackRefAtomID = 1,                            /* New with 2.1, it adds a track reference to select between multiple image tracks*/
  109.     kQTVRObjectHotSpotTrackRefAtomID = 1                        /* New with 2.1, it adds a track reference to select between multiple hotspot tracks*/
  110. };
  111.  
  112. /* Track reference types*/
  113.  
  114. enum {
  115.     kQTVRImageTrackRefType        = FOUR_CHAR_CODE('imgt'),
  116.     kQTVRHotSpotTrackRefType    = FOUR_CHAR_CODE('hott')
  117. };
  118.  
  119. /* Old hot spot types*/
  120.  
  121. enum {
  122.     kQTVRHotSpotNavigableType    = FOUR_CHAR_CODE('navg')
  123. };
  124.  
  125. /* Valid bits used in QTVRLinkHotSpotAtom*/
  126.  
  127. enum {
  128.     kQTVRValidPan                = 1L << 0,
  129.     kQTVRValidTilt                = 1L << 1,
  130.     kQTVRValidFOV                = 1L << 2,
  131.     kQTVRValidViewCenter        = 1L << 3
  132. };
  133.  
  134.  
  135. /* Values for flags field in QTVRPanoSampleAtom*/
  136.  
  137. enum {
  138.     kQTVRPanoFlagHorizontal        = 1L << 0,
  139.     kQTVRPanoFlagLast            = 1L << 31
  140. };
  141.  
  142.  
  143. /* Values for locationFlags field in QTVRNodeLocationAtom*/
  144.  
  145. enum {
  146.     kQTVRSameFile                = 0
  147. };
  148.  
  149.  
  150. /* Header for QTVR track's Sample Description record (vrWorld atom container is appended)*/
  151.  
  152. struct QTVRSampleDescription {
  153.     UInt32                             descSize;                    /* total size of the QTVRSampleDescription*/
  154.     UInt32                             descType;                    /* must be 'qtvr'*/
  155.  
  156.     UInt32                             reserved1;                    /* must be zero*/
  157.     UInt16                             reserved2;                    /* must be zero*/
  158.     UInt16                             dataRefIndex;                /* must be zero*/
  159.  
  160.     UInt32                             data;                        /* Will be extended to hold vrWorld QTAtomContainer*/
  161.  
  162. };
  163. typedef struct QTVRSampleDescription    QTVRSampleDescription;
  164. typedef QTVRSampleDescription *            QTVRSampleDescriptionPtr;
  165. typedef QTVRSampleDescriptionPtr *        QTVRSampleDescriptionHandle;
  166. /*
  167.   =================================================================================================
  168.    Definitions and structures used in the VRWorld QTAtomContainer
  169.   -------------------------------------------------------------------------------------------------
  170. */
  171.  
  172.  
  173. struct QTVRStringAtom {
  174.     UInt16                             stringUsage;
  175.     UInt16                             stringLength;
  176.     unsigned char                     theString[4];                /* field previously named "string"*/
  177. };
  178. typedef struct QTVRStringAtom            QTVRStringAtom;
  179. typedef QTVRStringAtom *                QTVRStringAtomPtr;
  180.  
  181.  
  182. struct QTVRWorldHeaderAtom {
  183.     UInt16                             majorVersion;
  184.     UInt16                             minorVersion;
  185.  
  186.     QTAtomID                         nameAtomID;
  187.     UInt32                             defaultNodeID;
  188.     UInt32                             vrWorldFlags;
  189.  
  190.     UInt32                             reserved1;
  191.     UInt32                             reserved2;
  192. };
  193. typedef struct QTVRWorldHeaderAtom        QTVRWorldHeaderAtom;
  194. typedef QTVRWorldHeaderAtom *            QTVRWorldHeaderAtomPtr;
  195.  
  196. /* Valid bits used in QTVRPanoImagingAtom*/
  197.  
  198. enum {
  199.     kQTVRValidCorrection        = 1L << 0,
  200.     kQTVRValidQuality            = 1L << 1,
  201.     kQTVRValidDirectDraw        = 1L << 2,
  202.     kQTVRValidFirstExtraProperty = 1L << 3
  203. };
  204.  
  205.  
  206. struct QTVRPanoImagingAtom {
  207.     UInt16                             majorVersion;
  208.     UInt16                             minorVersion;
  209.  
  210.     UInt32                             imagingMode;
  211.     UInt32                             imagingValidFlags;
  212.  
  213.     UInt32                             correction;
  214.     UInt32                             quality;
  215.     UInt32                             directDraw;
  216.     UInt32                             imagingProperties[6];        /* for future properties*/
  217.  
  218.     UInt32                             reserved1;
  219.     UInt32                             reserved2;
  220. };
  221. typedef struct QTVRPanoImagingAtom        QTVRPanoImagingAtom;
  222. typedef QTVRPanoImagingAtom *            QTVRPanoImagingAtomPtr;
  223.  
  224. struct QTVRNodeLocationAtom {
  225.     UInt16                             majorVersion;
  226.     UInt16                             minorVersion;
  227.  
  228.     OSType                             nodeType;
  229.     UInt32                             locationFlags;
  230.     UInt32                             locationData;
  231.  
  232.     UInt32                             reserved1;
  233.     UInt32                             reserved2;
  234. };
  235. typedef struct QTVRNodeLocationAtom        QTVRNodeLocationAtom;
  236. typedef QTVRNodeLocationAtom *            QTVRNodeLocationAtomPtr;
  237. /*
  238.   =================================================================================================
  239.    Definitions and structures used in the Nodeinfo QTAtomContainer
  240.   -------------------------------------------------------------------------------------------------
  241. */
  242.  
  243.  
  244. struct QTVRNodeHeaderAtom {
  245.     UInt16                             majorVersion;
  246.     UInt16                             minorVersion;
  247.  
  248.     OSType                             nodeType;
  249.     QTAtomID                         nodeID;
  250.     QTAtomID                         nameAtomID;
  251.     QTAtomID                         commentAtomID;
  252.  
  253.     UInt32                             reserved1;
  254.     UInt32                             reserved2;
  255. };
  256. typedef struct QTVRNodeHeaderAtom        QTVRNodeHeaderAtom;
  257. typedef QTVRNodeHeaderAtom *            QTVRNodeHeaderAtomPtr;
  258.  
  259. struct QTVRAngleRangeAtom {
  260.     Float32                         minimumAngle;
  261.     Float32                         maximumAngle;
  262. };
  263. typedef struct QTVRAngleRangeAtom        QTVRAngleRangeAtom;
  264. typedef QTVRAngleRangeAtom *            QTVRAngleRangeAtomPtr;
  265.  
  266. struct QTVRHotSpotInfoAtom {
  267.     UInt16                             majorVersion;
  268.     UInt16                             minorVersion;
  269.  
  270.     OSType                             hotSpotType;
  271.     QTAtomID                         nameAtomID;
  272.     QTAtomID                         commentAtomID;
  273.  
  274.     SInt32                             cursorID[3];
  275.  
  276.                                                                 /* canonical view for this hot spot*/
  277.     Float32                         bestPan;
  278.     Float32                         bestTilt;
  279.     Float32                         bestFOV;
  280.     QTVRFloatPoint                     bestViewCenter;
  281.  
  282.                                                                 /* Bounding box for this hot spot*/
  283.     Rect                             hotSpotRect;
  284.  
  285.     UInt32                             flags;
  286.     UInt32                             reserved1;
  287.     UInt32                             reserved2;
  288. };
  289. typedef struct QTVRHotSpotInfoAtom        QTVRHotSpotInfoAtom;
  290. typedef QTVRHotSpotInfoAtom *            QTVRHotSpotInfoAtomPtr;
  291.  
  292. struct QTVRLinkHotSpotAtom {
  293.     UInt16                             majorVersion;
  294.     UInt16                             minorVersion;
  295.  
  296.     UInt32                             toNodeID;
  297.  
  298.     UInt32                             fromValidFlags;
  299.     Float32                         fromPan;
  300.     Float32                         fromTilt;
  301.     Float32                         fromFOV;
  302.     QTVRFloatPoint                     fromViewCenter;
  303.  
  304.     UInt32                             toValidFlags;
  305.     Float32                         toPan;
  306.     Float32                         toTilt;
  307.     Float32                         toFOV;
  308.     QTVRFloatPoint                     toViewCenter;
  309.  
  310.     Float32                         distance;
  311.  
  312.     UInt32                             flags;
  313.     UInt32                             reserved1;
  314.     UInt32                             reserved2;
  315. };
  316. typedef struct QTVRLinkHotSpotAtom        QTVRLinkHotSpotAtom;
  317. typedef QTVRLinkHotSpotAtom *            QTVRLinkHotSpotAtomPtr;
  318. /*
  319.   =================================================================================================
  320.    Definitions and structures used in Panorama and Object tracks
  321.   -------------------------------------------------------------------------------------------------
  322. */
  323.  
  324.  
  325. struct QTVRPanoSampleAtom {
  326.     UInt16                             majorVersion;
  327.     UInt16                             minorVersion;
  328.  
  329.     UInt32                             imageRefTrackIndex;            /* track reference index of the full res image track*/
  330.     UInt32                             hotSpotRefTrackIndex;        /* track reference index of the full res hot spot track*/
  331.  
  332.     Float32                         minPan;
  333.     Float32                         maxPan;
  334.     Float32                         minTilt;
  335.     Float32                         maxTilt;
  336.     Float32                         minFieldOfView;
  337.     Float32                         maxFieldOfView;
  338.  
  339.     Float32                         defaultPan;
  340.     Float32                         defaultTilt;
  341.     Float32                         defaultFieldOfView;
  342.  
  343.                                                                 /* Info for highest res version of image track*/
  344.     UInt32                             imageSizeX;                    /* pixel width of the panorama (e.g. 768)*/
  345.     UInt32                             imageSizeY;                    /* pixel height of the panorama (e.g. 2496)*/
  346.     UInt16                             imageNumFramesX;            /* diced frames wide (e.g. 1)*/
  347.     UInt16                             imageNumFramesY;            /* diced frames high (e.g. 24)*/
  348.  
  349.                                                                 /* Info for highest res version of hotSpot track*/
  350.     UInt32                             hotSpotSizeX;                /* pixel width of the hot spot panorama (e.g. 768)*/
  351.     UInt32                             hotSpotSizeY;                /* pixel height of the hot spot panorama (e.g. 2496)*/
  352.     UInt16                             hotSpotNumFramesX;            /* diced frames wide (e.g. 1)*/
  353.     UInt16                             hotSpotNumFramesY;            /* diced frames high (e.g. 24)*/
  354.  
  355.     UInt32                             flags;
  356.     UInt32                             reserved1;
  357.     UInt32                             reserved2;
  358.  
  359. };
  360. typedef struct QTVRPanoSampleAtom        QTVRPanoSampleAtom;
  361. typedef QTVRPanoSampleAtom *            QTVRPanoSampleAtomPtr;
  362. /* Special resolution values for the Image Track Reference Atoms. Use only one value per track reference.*/
  363.  
  364. enum {
  365.     kQTVRFullTrackRes            = kQTVRFullRes,
  366.     kQTVRHalfTrackRes            = kQTVRHalfRes,
  367.     kQTVRQuarterTrackRes        = kQTVRQuarterRes,
  368.     kQTVRPreviewTrackRes        = 0x8000
  369. };
  370.  
  371.  
  372. struct QTVRTrackRefEntry {
  373.     UInt32                             trackRefType;
  374.     UInt16                             trackResolution;
  375.     UInt32                             trackRefIndex;
  376. };
  377. typedef struct QTVRTrackRefEntry        QTVRTrackRefEntry;
  378. /*
  379.   =================================================================================================
  380.    Object File format 2.0
  381.   -------------------------------------------------------------------------------------------------
  382. */
  383.  
  384. enum {
  385.     kQTVRObjectAnimateViewFramesOn = (1L << 0),
  386.     kQTVRObjectPalindromeViewFramesOn = (1L << 1),
  387.     kQTVRObjectStartFirstViewFrameOn = (1L << 2),
  388.     kQTVRObjectAnimateViewsOn    = (1L << 3),
  389.     kQTVRObjectPalindromeViewsOn = (1L << 4),
  390.     kQTVRObjectSyncViewToFrameRate = (1L << 5),
  391.     kQTVRObjectDontLoopViewFramesOn = (1L << 6),
  392.     kQTVRObjectPlayEveryViewFrameOn = (1L << 7),
  393.     kQTVRObjectStreamingViewsOn    = (1L << 8)
  394. };
  395.  
  396.  
  397. enum {
  398.     kQTVRObjectWrapPanOn        = (1L << 0),
  399.     kQTVRObjectWrapTiltOn        = (1L << 1),
  400.     kQTVRObjectCanZoomOn        = (1L << 2),
  401.     kQTVRObjectReverseHControlOn = (1L << 3),
  402.     kQTVRObjectReverseVControlOn = (1L << 4),
  403.     kQTVRObjectSwapHVControlOn    = (1L << 5),
  404.     kQTVRObjectTranslationOn    = (1L << 6)
  405. };
  406.  
  407.  
  408. enum {
  409.     kGrabberScrollerUI            = 1,                            /* "Object" */
  410.     kOldJoyStickUI                = 2,                            /*  "1.0 Object as Scene"     */
  411.     kJoystickUI                    = 3,                            /* "Object In Scene"*/
  412.     kGrabberUI                    = 4,                            /* "Grabber only"*/
  413.     kAbsoluteUI                    = 5                                /* "Absolute pointer"*/
  414. };
  415.  
  416.  
  417.  
  418. struct QTVRObjectSampleAtom {
  419.     UInt16                             majorVersion;                /* kQTVRMajorVersion*/
  420.     UInt16                             minorVersion;                /* kQTVRMinorVersion*/
  421.     UInt16                             movieType;                    /* ObjectUITypes*/
  422.     UInt16                             viewStateCount;                /* The number of view states 1 based*/
  423.     UInt16                             defaultViewState;            /* The default view state number. The number must be 1 to viewStateCount*/
  424.     UInt16                             mouseDownViewState;            /* The mouse down view state.   The number must be 1 to viewStateCount*/
  425.     UInt32                             viewDuration;                /* The duration of each view including all animation frames in a view*/
  426.     UInt32                             columns;                    /* Number of columns in movie*/
  427.     UInt32                             rows;                        /* Number rows in movie*/
  428.     Float32                         mouseMotionScale;            /* 180.0 for kStandardObject or kQTVRObjectInScene, actual degrees for kOldNavigableMovieScene.*/
  429.     Float32                         minPan;                        /* Start   horizontal pan angle in degrees*/
  430.     Float32                         maxPan;                        /* End     horizontal pan angle in degrees*/
  431.     Float32                         defaultPan;                    /* Initial horizontal pan angle in degrees (poster view)*/
  432.     Float32                         minTilt;                    /* Start   vertical   pan angle in degrees*/
  433.     Float32                         maxTilt;                    /* End     vertical   pan angle in degrees*/
  434.     Float32                         defaultTilt;                /* Initial vertical   pan angle in degrees (poster view)    */
  435.     Float32                         minFieldOfView;                /* minimum field of view setting (appears as the maximum zoom effect) must be >= 1*/
  436.     Float32                         fieldOfView;                /* the field of view range must be >= 1*/
  437.     Float32                         defaultFieldOfView;            /* must be in minFieldOfView and maxFieldOfView range inclusive*/
  438.     Float32                         defaultViewCenterH;
  439.     Float32                         defaultViewCenterV;
  440.  
  441.     Float32                         viewRate;
  442.     Float32                         frameRate;
  443.     UInt32                             animationSettings;            /* 32 reserved bit fields*/
  444.     UInt32                             controlSettings;            /* 32 reserved bit fields*/
  445.  
  446. };
  447. typedef struct QTVRObjectSampleAtom        QTVRObjectSampleAtom;
  448. typedef QTVRObjectSampleAtom *            QTVRObjectSampleAtomPtr;
  449. #if OLDROUTINENAMES
  450.  
  451. typedef QTVRStringAtom                     VRStringAtom;
  452. typedef QTVRWorldHeaderAtom             VRWorldHeaderAtom;
  453. typedef QTVRPanoImagingAtom             VRPanoImagingAtom;
  454. typedef QTVRNodeLocationAtom             VRNodeLocationAtom;
  455. typedef QTVRNodeHeaderAtom                 VRNodeHeaderAtom;
  456. typedef QTVRAngleRangeAtom                 VRAngleRangeAtom;
  457. typedef QTVRHotSpotInfoAtom             VRHotSpotInfoAtom;
  458. typedef QTVRLinkHotSpotAtom             VRLinkHotSpotAtom;
  459. typedef QTVRPanoSampleAtom                 VRPanoSampleAtom;
  460. typedef QTVRTrackRefEntry                 VRTrackRefEntry;
  461. typedef QTVRObjectSampleAtom             VRObjectSampleAtom;
  462. #endif  /* OLDROUTINENAMES */
  463.  
  464.  
  465.  
  466.  
  467. #if PRAGMA_STRUCT_ALIGN
  468.     #pragma options align=reset
  469. #elif PRAGMA_STRUCT_PACKPUSH
  470.     #pragma pack(pop)
  471. #elif PRAGMA_STRUCT_PACK
  472.     #pragma pack()
  473. #endif
  474.  
  475. #ifdef PRAGMA_IMPORT_OFF
  476. #pragma import off
  477. #elif PRAGMA_IMPORT
  478. #pragma import reset
  479. #endif
  480.  
  481. #ifdef __cplusplus
  482. }
  483. #endif
  484.  
  485. #endif /* __QUICKTIMEVRFORMAT__ */
  486.  
  487.